package com.controller;

import com.domain.others.Destination;
import com.google.common.collect.Lists;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 */
@RestController("demo")
public class DemoController{
    static List<Destination>  destinations = null;
    static {
        Destination destination1 = Destination.builder().id(1).name("cat1").description("very good cat111").url("https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=1600").slug("cat1").build();
        Destination destination2 = Destination.builder().id(2).name("cat2").description("very good cat222").url("https://images.pexels.com/photos/617278/pexels-photo-617278.jpeg?auto=compress&cs=tinysrgb&w=1600").slug("cat2").build();
        Destination destination3 = Destination.builder().id(3).name("cat3").description("very good cat333").url("https://images.pexels.com/photos/416160/pexels-photo-416160.jpeg?auto=compress&cs=tinysrgb&w=1600").slug("cat3").build();
        destinations =  Lists.newArrayList();
        destinations.add(destination1);
        destinations.add(destination2);
        destinations.add(destination3);
    }

    @GetMapping("catData/{id}")
    public Destination get(@PathVariable("id")int id){

        // mock data
        return destinations.get(id);
    }

}
